package jsen.tool.ddd.adapter.infrastructure.specification.demo.spec.simple;

import jsen.tool.ddd.adapter.infrastructure.specification.ISpecification;
import jsen.tool.ddd.adapter.infrastructure.specification.base.Sdl;
import jsen.tool.ddd.adapter.infrastructure.specification.base.SdlSpecificationSupplier;

/**
 * @author jsen
 * @date 2021/10/6
 */
public class SimpleSpecFactory {

    public static ISpecification<String> buildSpec(String sdl) {
        SdlSpecificationSupplier factory = new SdlSpecificationSupplier();
        factory.register("s1", SimpleSpec1::new);
        factory.register("s2", SimpleSpec2::new);
        factory.register("s3", SimpleSpec3::new);
        factory.register("s4", SimpleSpec4::new);
        factory.register("s5", SimpleSpec5::new);

        return new Sdl<>(sdl, factory);
    }
}
